package com.Design.Singleton;

/**
 * @Author Lc
 * @Date 2023/9/28
 * @PackageName: com.Design.Singleton
 * @ClassName: Person
 * @Description:
 */

public class Person {
    public static volatile Person person;

    private Person() {
    }

    public static   Person getInstance(){
        if(person == null){
         synchronized (Person.class) {
             //防止多个线程进入创建实例
             if(person == null){
                 person = new Person();
             }
         }
        }
        return person;
    }
}
